/*
 * @lc app=leetcode.cn id=709 lang=javascript
 *
 * [709] 转换成小写字母
 */

// @lc code=start
/**
 * @param {string} str
 * @return {string}
 */
var toLowerCase = function(str) {
    let  map=new Map([["A","a"],["B","b"],["C","c"],["D","d"],["E","e"],["F","f"],["G","g"],["H","h"],["I","i"],["J","j"],["K","k"],["L","l"],["M","m"],["N","n"],["O","o"],["P","p"],["Q","q"],["R","r"],["S","s"],["T","t"],["U","u"],["V","v"],["W","w"],["X","x"],["Y","y"],["Z","z"]])
    let res=""
    for(let i=0;i<str.length;i++){
        res+=map.get(str[i])?map.get(str[i]):str[i]
    }
    return res
};
// @lc code=end

var toLowerCase = function(str) {
    let ret = ''
    for(let i = 0; i < str.length; i++){
      let code = str.charCodeAt(i)
      if(code <= 90 && code>=65){
        ret += String.fromCharCode(code + 32)
      }else{
        ret += str[i]
      }
    }
    return ret
  };
  